package com.qk.mapper;

import com.qk.entity.Course;
import com.qk.dto.CourseDto;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CourseMapper {

    List<Course> selectList(CourseDto courseDto);
    @Delete("delete from course where id=#{id}")
    void deleteById(Integer id);

    void insert(Course course);
    @Select("select id, name, subject, price, target, description, create_time, update_time from course where id= #{id}")
    Course selectById(Integer id);

    void updateById(Course course);
    @Select("select id, name, subject, price, target, description, create_time, update_time from course")
    List<Course> alldeptList();
    @Select("select id, name, subject, price, target, description, create_time, update_time from course where subject= #{subject}")
    List<Course> selectlist(Integer subject);
}
